-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tutorials for ApplyForceTorque and MouseDrag plugins #2083
Conversation
Signed-off-by: Henrique-BO <[email protected]>
Signed-off-by: Henrique-BO <[email protected]>
Codecov Report
@@ Coverage Diff @@
## gz-sim7 #2083 +/- ##
===========================================
- Coverage 64.98% 64.97% -0.02%
===========================================
Files 356 356
Lines 28783 28783
===========================================
- Hits 18704 18701 -3
- Misses 10079 10082 +3 |
tutorials/apply_force_torque.md
Outdated
## Examples | ||
|
||
Let's go through an example of applying force and torque to simple models. Open | ||
the `shapes` world with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the `shapes` world with | |
the `shapes.sdf` world with: |
tutorials/apply_force_torque.md
Outdated
![Interface](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/apply_force_torque/Interface.png) | ||
|
||
|
||
### Apply force to a link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![Interface](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/apply_force_torque/Interface.png) | |
### Apply force to a link | |
![Interface](https://raw.githubusercontent.com/gazebosim/gz-sim/main/tutorials/files/apply_force_torque/Interface.png) | |
### Apply force to a link |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in f977a8c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some minor comments
@@ -0,0 +1,115 @@ | |||
\page apply_force_torque Apply Force and Torque |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you'll need to add a link to this page in https://github.com/gazebosim/gz-sim/blob/gz-sim7/tutorials.md.in
tutorials/apply_force_torque.md
Outdated
|
||
On the dialog, write `10000` on the `X` field under `Force`. Click on the force | ||
vector to make the rotation tool appear. Drag the blue circle to rotate the | ||
force so that it is alligned with the `Y` direction. Notice how the XYZ fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
force so that it is alligned with the `Y` direction. Notice how the XYZ fields | |
force around the `Z` axis so that it is aligned with the `Y` direction. Notice how the XYZ fields |
tutorials/apply_force_torque.md
Outdated
### Force | ||
|
||
- **Force X, Y, Z**: Each field specifies how much force will be applied on that | ||
direction, in N. The frame is fixed to the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
direction, in N. The frame is fixed to the link. | |
direction, in Newtons (N). The frame is fixed to the link. |
tutorials/apply_force_torque.md
Outdated
in meters. Here you can edit the X, Y and Z fields to give the force an offset | ||
with respect to the center of mass expressed in the link's frame. | ||
|
||
- **Tip**: Right-click the model and choose View -> Center of mass to see its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Tip**: Right-click the model and choose View -> Center of mass to see its | |
- **Tip**: Right-click the model and choose `View` -> `Center of Mass` to see its |
tutorials/apply_force_torque.md
Outdated
with respect to the center of mass expressed in the link's frame. | ||
|
||
- **Tip**: Right-click the model and choose View -> Center of mass to see its | ||
position. You might want to also make the model transparent for that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position. You might want to also make the model transparent for that. | |
position. You will want to also make the model transparent to see the center of mass visual (`View` -> `Transparent`). |
tutorials/apply_force_torque.md
Outdated
position. You might want to also make the model transparent for that. | ||
|
||
- **Apply Force**: Click this to apply only force for one time step. Keep in | ||
mind that time steps are in the order of milliseconds, so relatively large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind that time steps are in the order of milliseconds, so relatively large | |
mind that time steps are typically in the order of milliseconds, so relatively large |
tutorials/apply_force_torque.md
Outdated
### Torque | ||
|
||
- **X, Y, Z**: Each field specifies how much torque will be applied about that | ||
axis, in N.m. The frame is fixed to the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
axis, in N.m. The frame is fixed to the link. | |
axis, in Newton-meters (N.m). The frame is fixed to the link. |
tutorials/apply_force_torque.md
Outdated
fields proportionally, maintaining the torque direction. | ||
|
||
- **Apply Torque**: Click this to apply only torque for one time step. Keep in | ||
mind that time steps are in the order of milliseconds, so relatively large |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind that time steps are in the order of milliseconds, so relatively large | |
mind that time steps are typically in the order of milliseconds, so relatively large |
tutorials/apply_force_torque.md
Outdated
editing the numbers on the XYZ fields. | ||
|
||
From the scene, select a vector to enable the rotation tool, then drag the | ||
circles. This changes the direction of the vector, updating the XYZ fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
circles. This changes the direction of the vector, updating the XYZ fields | |
handles. This changes the direction of the vector, updating the XYZ fields |
@@ -0,0 +1,66 @@ | |||
\page mouse_drag Mouse Drag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 8a4afa7
Signed-off-by: Henrique-BO <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just have a minor suggestion on what section to put the tutorials in, otherwise this looks good to me.
tutorials.md.in
Outdated
@@ -51,6 +51,8 @@ Gazebo @GZ_DESIGNATION_CAP@ library and how to use the library effectively. | |||
* \subpage spherical_coordinates "Spherical coordinates": Working with latitude and longitude | |||
* \subpage underwater_vehicles "Underwater Vehicles": Understand how to simulate underwater vehicles. | |||
* \subpage logicalaudiosensor "Logical Audio Sensor": Using the LogicalAudioSensor system to mimic logical audio emission and detection in simulation. | |||
* \subpage apply_force_torque "Apply Force and Torque": Applying forces and/or torques to models during simulation through the GUI. | |||
* \subpage mouse_drag "Mouse Drag": Move models by dragging them in the scene using forces and torques. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these are GUI and rendering features?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, changed it in 33e5d79
Signed-off-by: Henrique-BO <[email protected]>
🎉 New feature
Requires #2051, #2056
Summary
Adds tutorials for the new ApplyForceTorque plugin (including the features added in #2051 and #2056) and for the new MouseDrag plugin.
Test it
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.